package com.ty.day4;

import java.util.Scanner;

/**
 * Created by IntelliJ IDEA.
 *
 * @author : txy
 * @create : 2023/11/9 14:41
 */
public class Four {
    public static void main(String[] args) {
        int result= (int) (Math.random()*1000);
        Scanner sc = new Scanner(System.in);
        System.out.println("欢迎来到猜数游戏");
        System.out.println("请输入你的猜想：");
        int x,count=0;
        while(true){
            x =sc.nextInt();
            count++;
            if (x==result){
                System.out.println("恭喜猜对了，666送给你！！");
                break;
            }
            if (x<result){
                System.out.println("大胆一点，数字有点小哦");
                continue;
            }
            if (x>result){
                System.out.println("胆子太大了，数字猜小一点嘛");
            }
        }
        System.out.println("厉害只猜了"+count+"次");
    }
}
